﻿@inject NavigationManager Nav

<Router AppAssembly="@typeof(App).Assembly">
    <Found Context="routeData">
        <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"/>
        <FocusOnNavigate RouteData="@routeData" Selector="h1"/>
    </Found>
    <NotFound>
        <PageTitle>Not found</PageTitle>
        <LayoutView Layout="@typeof(MainLayout)">
            <Result Status="404"
                    Title="404"
                    SubTitle="对不起，您访问的页面不存在">
                <Extra>
                    <Button Type="@ButtonType.Primary" OnClick="@(() => Nav.NavigateTo(""))">回到主页</Button>
                </Extra>
            </Result>
        </LayoutView>
    </NotFound>
</Router>